package cn.nexd.location.indoor;

import android.content.Context;
import android.text.TextUtils;

import java.io.File;

import cn.nexd.location.indoor.utils.AndroidUtil;

/**
 * Created by codngfish on 16/5/5.
 */
public class NexdIndoorLocation {

    public enum LocationState {
        ////////////// location interrupt ///////////////
        LOCATION_INTERRUPT_COLLECTOR_UNAVAILABLE(1008601),
        LOCATION_FAILED_COLLECTOR_CONFIG_UNCONSISTENT(1008602),//数据与配置文件不对应
        LOCATION_INTERRUP_LOCATION_CONFIG_NONEXISTENT(1008603),//配置文件不存在
        LOCATION_INTERRUPT_TYPE_PERMISSION_UNAVAILABLE(1008604),// 权限设置
        LOCATION_INTERRUPT_TYPE_COLLECTOR_UNAVAILABLE(1008605), // 不支持
        LOCATION_INTERRUPT_TYPE_COLLECTOR_STATE_UNAVAILABLE(1008606),// 状态不可用
        LOCATION_INTERRUPT_TYPE_CAN_NOT_ACCESS_DATA(1008607), // 被360中断
        LOCATION_FAILED_TYPE_NO_BEACON_FOUND(1008608),
        LOCATION_FAILED_TYPE_NO_WIFI_FOUND(1008609),
        LOCATION_INTERRUPT_TYPE_NO_WIFI_BEACON_FOUND(1008610);

        private int locationStateId;

        LocationState(int locationStateId) {
            this.locationStateId = locationStateId;
        }

        public int getLocationStateId() {
            return locationStateId;
        }
    }

    public static String BASE_CONFIGURATION_PATH = "";

    public static String LOCATION = "location";

    public static String getConfigurationPath(Context context, long buildingId) {
        return (TextUtils.isEmpty(BASE_CONFIGURATION_PATH) ? AndroidUtil.getDiskCacheDir(context, "nexdLocation") : BASE_CONFIGURATION_PATH) + File.separator + LOCATION + File.separator + Long.toString(buildingId) + File.separator;
    }

    //    public static String getLocationConfigurationPath(long buildingId) {
    //        return BASE_CONFIGURATION_PATH + File.separator + LOCATION + File.separator + Long.toString(buildingId) + File.separator;
    //    }
}
